{% extends 'base.html' %}
{% block title %}
<title>登录</title>
{% endblock %}


{% block body %}
<h1>登录</h1>

<div class="row col-md-6 col-md-offset-3">

    <form action="" method="post">
        {% csrf_token %}
        <div class="form-group">
            {{ forms.username.label_tag }}
            {{ forms.username }}
        </div>
        <div class="form-group">
            {{ forms.password.label_tag }}
            {{ forms.password }}
        </div>
        {% if request.method == "POST" %}
        <div class="form-group">
            <p class="text-danger">{{ errors }}</p>
        </div>
        {% endif %}

        <button type="submit" class="btn btn-default">登录</button>
        <a class="btn btn-default" href="{% url 'user:register' %}" role="button">没有账号？去注册</a>
        <a class="btn btn-default" href="{% url 'main:index' %}" role="button">返回首页</a>
    </form>
    <br>

    <a href="https://api.weibo.com/oauth2/authorize?client_id=1121631288&redirect_uri=http://127.0.0.1:8000/user/auth/"><img src="/static/img/微博.png"></a>

</div>
{% endblock %}


















